<%--
  Created by IntelliJ IDEA.
  User: Shinelon
  Date: 2018-08-08
  Time: 8:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.css"/>

<link rel="stylesheet" href="${pageContext.request.contextPath}/static/table/bootstrap-table.min.css"/>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/table/bootstrap-table.min.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/table/locale/bootstrap-table-zh-CN.min.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
<%--<script src="../../static/laydate/laydate.js" />--%>


<link rel="stylesheet" href="${pageContext.request.contextPath}/static/easyui/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/icon.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/demo.css">

<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.easyui.min.js"></script>


<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/AmazeUI/css/amazeui.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/AmazeUI/js/amazeui.js"></script>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/sweetalert/sweetalert.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/scwuyefei.js"></script>
<html>

<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function(){
        var element = layui.element;
    });
    function jia(){
        $("#save").show();
        var i = $("#men").val();
        $.post("${pageContext.request.contextPath}/lin/list",{"name":i},function(date){
            $("#table1").bootstrapTable("load",date);
        })
    }

    function jia1(){
        $("#save1").show();
        var i = $("#men1").val();
        $.post("${pageContext.request.contextPath}/lin/list",{"name":i},function(date){
            $("#table2").bootstrapTable("load",date);
        })
    }
</script>
<style type="text/css">
    .yin{
        display: none;
    }
    .xian{
        display: block;
    }
    .table-hover > tbody > tr:hover {
        background-color: rgba(255, 255, 255, 0);
    }
</style>
<head>
    <title>Title</title>
</head>
<body>
    <div id="da">
        <div>

            <div style="margin: -6px 0;" class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" >
                <ul class="layui-tab-title">
                    <li class="layui-this">生成新的表类账单</li>
                    <li>生成新的平米类账单</li>
                    <li>查询历史信息</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">

                       <div style="margin: -20px 0px 0px 0px;padding: 10px 0;">
                           请选择收费项:
                           <%--<input id="firstDate" type="text" class="form-control">--%>
                           <select id="men" data-am-selected="{searchBox: 1}" data-am-selected="{maxHeight: 100}">
                               <option value="-1">请选择</option>

                           </select>
                                <button id="sel" onclick="jia()" class="layui-btn layui-btn-normal layui-btn-radius">生成新账单</button>
                                <%--<button id="save" onclick="dangan()" class="layui-btn layui-btn-normal layui-btn-radius">保存</button>--%>
                                <button id="save" type="button" class="layui-btn layui-btn-normal layui-btn-radius" data-toggle="modal" data-target="#exampleModal">保存</button>
                       </div>
                        <table id="table1"></table>
                    </div>
                    <div class="layui-tab-item">
                        <div style="margin: -20px 0px 0px 0px;padding: 10px 0;">
                            请选择收费项:
                            <%--<input id="firstDate" type="text" class="form-control">--%>
                            <select id="men1" data-am-selected="{searchBox: 1}" data-am-selected="{maxHeight: 100}">
                                <option value="-1">请选择</option>

                            </select>
                            <button id="sel1" onclick="jia1()" class="layui-btn layui-btn-normal layui-btn-radius">生成新账单</button>
                            <button id="save1" type="button" class="layui-btn layui-btn-normal layui-btn-radius" data-toggle="modal" data-target="#exampleModal1">保存</button>
                        </div>
                        <table id="table2"></table>
                    </div>
                    <div class="layui-tab-item">
                        <form class="form-inline">
                            <%--按时间查询--%>
                            请选择时间范围：
                            <div class="layui-input-inline">
                            <input type="text" style="width: 230px;" class="layui-input form-control" id="test6" placeholder=" ~ ">
                            </div>
                            &nbsp;
                            <%--按供货商查询--%>
                            档案号:
                            <%--<input id="firstDate" type="text" class="form-control">--%>
                           <input type="text" id="danhao" class="form-control">

                            <button onclick="search()" type="button" class="btn btn-default">查询</button>
                        </form>
                        <table id="dg"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel">物业费台账档案</h4>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <label for="dname" class="control-label">档案名称:</label>
                            <input type="text" class="form-control" id="dname">
                        </div>
                        <div class="form-group">
                            <label for="ddate" class="control-label">建档日期:</label>
                            <input type="text" class="form-control layui-input" id="ddate" placeholder="yyyy-MM-dd">
                        </div>
                        <div class="form-group">
                            <label for="djname" class="control-label">缴费名称:</label>
                            <input type="text" class="form-control" id="djname">
                        </div>
                        <div class="form-group">
                            <label for="dremark" class="control-label">备注:</label>
                            <input type="text" class="form-control" id="dremark">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" onclick="save()" id="bb" data-dismiss="modal" class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="exampleModal1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel1">物业费台账档案</h4>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <label for="dname1" class="control-label">档案名称:</label>
                            <input type="text" class="form-control" id="dname1">
                        </div>
                        <div class="form-group">
                            <label for="ddate1" class="control-label">建档日期:</label>
                            <input type="text" class="form-control layui-input" id="ddate1" placeholder="yyyy-MM-dd">
                        </div>
                        <div class="form-group">
                            <label for="djname1" class="control-label">缴费名称:</label>
                            <input type="text" class="form-control" id="djname1">
                        </div>
                        <div class="form-group">
                            <label for="dremark1" class="control-label">备注:</label>
                            <input type="text" class="form-control" id="dremark1">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" onclick="save1()" data-dismiss="modal" class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>





</body>
<script type="text/javascript">
    $(function(){
        $.post("${pageContext.request.contextPath}/costitem/shu",function (releset) {
            var e=releset;
            $(e).each(function (i,e) {
                if(e.type=='平米'){
                    $('#men1').append('<option value='+e.id+' >'+e.name+'</option>');
                }else{
                    $('#men').append('<option value='+e.id+' >'+e.name+'</option>');
                }
            })
        })
    })

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#ddate'
        });
        laydate.render({
            elem: '#ddate1'
        });
        laydate.render({
            elem: '#test6'
            ,range: true//指定元素
        });
    });
</script>
</html>
